<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>新闻2</title>
    <script type="text/javascript" src="/js/jquery.js"></script>
  <script>
    function zan(id){
      $.ajax({
        url:"/addZan",
        type:"get",
        data:"id="+id,
        success:function (data){
          $("#coountZan").text(data);
        }
      })
    }
  </script>
</head>
<body>
<h1 style="text-align: center">新闻2</h1>
阅读数<font color="red" th:text="${read}"></font>
点赞数<font color="red" id="countZan" th:text="${zan}"></font>
<input type="button" onclick="zan(2)" value="点赞">
</body>
</html>